package com.slg.android.manyanime.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.slg.android.manyanime.fragment.AnimeCategoryFragment;
import com.slg.android.manyanime.fragment.AnimeListFragment;
import com.slg.android.manyanime.fragment.AnimeRecommendFragment;

/**
 * Created by E540 on 2015/3/10.
 */
public class AnimeFragmentAdapter extends FragmentStatePagerAdapter {



    public AnimeFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        switch (position) {
            case 0:
                fragment = new AnimeRecommendFragment();
                break;
            case 1:
                fragment = new AnimeListFragment();
                break;
            case 2:
                fragment = new AnimeCategoryFragment();
                break;
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return 3;
    }


}
